﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Windows.Forms;
using ROrganizer.UI;

namespace ROrganizer
{
    internal static class Program
    {
        [STAThread]
        private static void Main(string[] args)
        {
            var extended = args.Any(x => x == "--extended");
            var crawler = args.Any(x => x == "--crawler");

            ServicePointManager.FindServicePoint(new Uri("http://imdb.com", UriKind.Absolute)).ConnectionLimit = 8;
            ServicePointManager.FindServicePoint(new Uri("http://amacal.pl", UriKind.Absolute)).ConnectionLimit = 2;

            ViewSettings.IsExtendedModeEnabled = extended;
            ViewManager.ApplicationIcon = Icon.ExtractAssociatedIcon(new Uri(typeof(Program).Assembly.CodeBase, true).AbsolutePath);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (crawler)
                ViewManager.RunCrawler();
            else
                ViewManager.RunROrganizer();
        }
    }
}
